import pprint

print("===================字典:“键-值”对、无序=======================")
myCat = {'size': 'fat', 'color': 'gray', 'disposition': 'loud'}
print(myCat['size'])
myCat['birthday'] = '2020-07-29'
for k in myCat.keys():
    print(k + ",", end="")
print()
for v in myCat.values():
    print(v + ",", end="")
print()
for item in myCat.items():
    print(item)
for k, v in myCat.items():
    print("k=" + k + ",v=" + v)
print('color' in myCat.keys())
print('color' not in myCat.values())
print(myCat.get("age", 12))  # 要取key为age的值，如果该键不存在时，返回备用值12
myCat.setdefault("birthday", '2020-07-29')
print(myCat.get("birthday"))


